import Common from "../Common/common"
export default class Scale extends Laya.Script {
    private scaleDelta: number = 0;
    constructor() {
        super();
        Common.timeArray.push(this)
    }

    onAwake() {
        // Laya.timer.once(500,this,this.upward);
        Laya.timer.frameLoop(1, this, this.animate)
    }

    private animate(e: Event): void {
        //心跳缩放

        this.scaleDelta -= 0.04;
        var scaleValue: number = Math.abs(Math.sin(this.scaleDelta)) / 3 + 0.8;
        this.owner.scale(scaleValue, scaleValue);
    }

}